<?php
/**
 * Created by Zend Studio.
 * User: FDG367
 * @param  FDG367 2018-03-20  553 【后台需求】用户在心愿单界面预约到店后，后台可查看用户预约到店时心愿单商品 start
 * Date: 2018/03/20
 * Time: 11:36
 */
namespace common\models;

use common\helps\tools;
use yii\db\ActiveRecord;

class ShareWishReservLog extends ActiveRecord{
    public static function tableName(){
        return '{{%share_wish_reserv_log}}';
    }
	const TYPE_ONE	=1;//心愿单联系记录
	const TYPE_TWO	=2;//心愿单操作日志

	const LOG_TYPE_ONE	=1;//客户提交预约门店
	const LOG_TYPE_TWO	=2;//2修改处理状态
	const LOG_TYPE_THR	=3;//3导出excel
	public function rules(){
		return [
			[['share_wish_reserv_id','type','log_type','content','record','oper','oper_time'],'safe'],

		];
	}
	public function  saveInfo(){
		$this->type	= self::TYPE_TWO;
		$this->log_type	=self::LOG_TYPE_ONE;
		$this->content	='客户提交预约门店。';
		$this->record	='';
		return $this->save();
	}

	public function beforeSave($insert){
		$this->oper_time  		= date('Y-m-d H:i:s');
		return true;
	}

}